<?
$fdat = '';


$url = "http://www.siye.co.uk/siye/viewuser.php?uid=".$_GET['aid'];

for($CH=65;$CH<=90;$CH++){
	$url = 'http://www.tthfanfic.com/authors.php?letter='.chr($CH).'%';
	//echo '<b>'.$url.'</b><hr>';
	$fdat =  file ( $url );
	while(list($key,$val)=each($fdat)){
		//$summary = true;
		if(stristr($val,'/Author-')){		
			//echo htmlspecialchars($val)."<hr>";
			$v = explode('/Author-',$val);
			$v = explode("'",$v[1]);
			//var_dump($v);
			$v2 = explode("/",$v[0]);
			$aid= $v2[0];
			$v2 = explode('[',$v[1]);
			//var_dump($v2);
			$aname = trim(str_replace('>','',$v2[0]));
			//echo $aname;
			$v3 = explode(']',$v2[1]);
			//echo $v3[0];
			if($v3[0]>0){
				$dataA[$aid]=array($aname,$v3[0]);
			}
			//echo "<hr>";
		}
	}
}

echo "&nbsp;&nbsp;&nbsp;Scan Complete<br>";
$cnt = 0; $cnt_n = 0; $cnt_u = 0; $cnt_Q = 0; $cnt_i = 0;

/*echo "<pre>";
var_dump($dataA);
echo "</pre>";
exit();	*/
while(list($k,$v)=each($dataA)){

$sql2 = "INSERT INTO `fic_authors` ( `sitekey`,`author_id` , `author_name` )VALUES ('T','".$k."', '".str_replace("'","''",$v[0])."')";
//echo $sql2."<br>";
			$rs2 = $db->Execute($sql2);

}

exit();
?>
